<template>
    <view class="container data-v-68528bb1" v-if="isInit">
        <view class="day-c data-v-68528bb1">
            <view class="item data-v-68528bb1" v-for="(item, n) in days" :key="n">
                <view :class="['round', 'data-v-68528bb1', days[n].is_completed ? 'completed' : '']">
                    <text class="new-iconfont icon-right data-v-68528bb1"></text>
                </view>

                <view class="score data-v-68528bb1">{{ '+' + days[n].score }}</view>

                <view class="day data-v-68528bb1">{{ '第' + days[n].number + '天' }}</view>
            </view>
        </view>
        <view @tap="__e" class="signin-btn data-v-68528bb1" :data-event-opts="[['tap', [['signIn', ['$event']]]]]" hoverClass="hover" v-if="!isSignIn">签到</view>
        <view class="signin-btn completed data-v-68528bb1" v-else>今天已签到</view>
        <view class="signin-total data-v-68528bb1">{{ '累计签到' + signinTotal + '天' }}</view>
    </view>
</template>

<script>
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/SigninCard/SigninCard'],
    {
        '2ca81': function (n, t, e) {},
        4003: function (n, t, e) {
            'use strict';

            e.r(t);
            var i = e('7399');
            var o = e('5292');
            for (var a in o) {
                if (['default'].indexOf(a) < 0) {
                    (function (n) {
                        e.d(t, n, function () {
                            return o[n];
                        });
                    })(a);
                }
            }
            e('6bcc');
            var r = e('f0c5');
            var c = Object(r.a)(o.default, i.b, i.c, false, null, '68528bb1', null, false, i.a, void 0);
            t.default = c.exports;
        },
        5292: function (n, t, e) {
            'use strict';

            e.r(t);
            var i = e('f144');
            var o = e.n(i);
            for (var a in i) {
                if (['default'].indexOf(a) < 0) {
                    (function (n) {
                        e.d(t, n, function () {
                            return i[n];
                        });
                    })(a);
                }
            }
            t.default = o.a;
        },
        '6bcc': function (n, t, e) {
            'use strict';

            var i = e('2ca81');
            e.n(i).a;
        },
        7399: function (n, t, e) {
            'use strict';

            e.d(t, 'b', function () {
                return i;
            });
            e.d(t, 'c', function () {
                return o;
            });
            e.d(t, 'a', function () {});
            var i = function () {
                this.$createElement;
                this._self._c;
            };
            var o = [];
        },
        f144: function (n, t, e) {
            'use strict';

            (function (n) {
                var i = e('4ea4');
                Object.defineProperty(t, '__esModule', {
                    value: true
                });
                t.default = void 0;
                var o = i(e('9523'));
                var a = e('26cb');
                function r(n, t) {
                    var e = Object.keys(n);
                    if (Object.getOwnPropertySymbols) {
                        var i = Object.getOwnPropertySymbols(n);
                        if (t) {
                            i = i.filter(function (t) {
                                return Object.getOwnPropertyDescriptor(n, t).enumerable;
                            });
                        }
                        e.push.apply(e, i);
                    }
                    return e;
                }
                var c = {
                    props: {
                        refreshCount: {
                            type: Number
                        }
                    },
                    computed: (function (n) {
                        for (var t = 1; t < arguments.length; t++) {
                            if (null != arguments[t]) {
                                var e = arguments[t];
                            } else {
                                var e = {};
                            }
                            if (t % 2) {
                                r(Object(e), true).forEach(function (t) {
                                    (0, o.default)(n, t, e[t]);
                                });
                            } else {
                                Object.getOwnPropertyDescriptors
                                    ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e))
                                    : r(Object(e)).forEach(function (t) {
                                          Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(e, t));
                                      });
                            }
                        }
                        return n;
                    })({}, (0, a.mapGetters)(['token'])),
                    data: function () {
                        return {
                            list: [],
                            signinTotal: 0,
                            isSignIn: false,
                            days: [],
                            isInit: false
                        };
                    },
                    watch: {
                        token: function () {
                            this.initData();
                        }
                    },
                    mounted: function () {
                        this.initData();
                    },
                    methods: {
                        initData: function () {
                            var that = this;
                            this.$http('/sign-in-card-info').then(function (t) {
                                that.days = t.data.days;
                                that.isSignIn = t.data.is_sign_in;
                                that.signinTotal = t.data.sign_in_total;
                                that.isInit = true;
                            });
                        },
                        signIn: function () {
                            var that = this;
                            n.showLoading({
                                title: '签到中'
                            });
                            this.$http('/sign-in', 'POST').then(function (e) {
                                n.hideLoading();
                                n.showModal({
                                    title: '连续签到'.concat(e.data.continuous_days, '天了哦~ ').concat(that.scoreAlias, '+').concat(e.data.award_score),
                                    confirmText: '朕知道了'
                                });
                                that.initData();
                            });
                        }
                    }
                };
                t.default = c;
            }.call(this, e('543d').default));
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/SigninCard/SigninCard-create-component',
    {
        'components/SigninCard/SigninCard-create-component': function (n, t, e) {
            e('543d').createComponent(e('4003'));
        }
    },
    [['components/SigninCard/SigninCard-create-component']]
]);
</script>
<style>
@import './SigninCard.css';
</style>
